/*******************************************************************************
 * Package: com.ruoyi.system.controller
 * Type:    ProductContorller
 * Date:    2024-03-04 9:12
 *
 * Copyright (c) 2024 LTD All Rights Reserved.
 *
 * You may not use this file except in compliance with the License.
 *******************************************************************************/
package com.ruoyi.system.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.system.api.domain.ShopProduct;
import com.ruoyi.system.mapper.ProductMapper;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



/**
 * 功能描述：分布式事务做feign调用
 *
 * @author Songxianyang
 * @date 2024-03-04 9:12
 */
@RestController
@RequestMapping("/product")
public class ProductController extends BaseController {
    @Autowired
    private ProductMapper productMapper;

    @Log(title = "新增", businessType = BusinessType.INSERT)
    @PostMapping("add")
    public AjaxResult add(@Validated @RequestBody ShopProduct shopProduct)
    {
        return toAjax(productMapper.insertShopProduct(shopProduct));
    }

}
